<!DOCTYPE HTML>
<!--
	Dimension by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
 <head>
  <title>
   Dimension by HTML5 UP
  </title>
  <!-- <meta charset="utf-8" /> -->
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> -->
  <meta charset="utf-8"/>
  <meta content="width=device-width,initial-scale=1.0" name="viewport"/>
  <link href="../../assets/css/article.css" rel="stylesheet"/>
  <link href="https://cdn.bootcss.com/highlight.js/9.15.8/styles/github.min.css" rel="stylesheet"/>
  <noscript>
   <link href="../../assets/css/noscript.css" rel="stylesheet"/>
  </noscript>
 </head>
 <body>
  <div id="app">
  </div>
  <!-- built files will be auto injected -->
 </body>
 <body class="is-preload">
  <!-- Wrapper -->
  <div id="wrapper">
   <!-- Main -->
   <div id="main">
    <article id="article">
     <h1 id="yapi">
      yapi 安装配置
     </h1>
     <hr/>
     <h2 id="_1">
      安装依赖
     </h2>
     <ul>
      <li>
       nodejs
      </li>
      <li>
       git
      </li>
      <li>
       MongoDB
      </li>
     </ul>
     <div class="codehilite">
      <pre><span></span><code>curl -sL https://rpm.nodesource.com/setup_10.x <span class="p">|</span> sudo bash -
yum install nodejs -y
npm install pm2@latest -g
</code></pre>
     </div>
     <div class="codehilite">
      <pre><span></span><code>mkdir yapi <span class="o">&amp;&amp;</span> <span class="nb">cd</span> yapi
git clone https://github.com/YMFE/yapi.git vendors --depth<span class="o">=</span><span class="m">1</span>
cp vendors/config_example.json ./config.json
vi ./config.json
</code></pre>
     </div>
     <div class="codehilite">
      <pre><span></span><code><span class="err">#</span> <span class="err">db.user</span> <span class="err">和</span> <span class="err">db.pass</span> <span class="err">是</span> <span class="err">mongodb</span> <span class="err">的用户名和密码，如果没有开启</span> <span class="err">mongo</span> <span class="err">认证功能，请删除这两个选项</span>
<span class="p">{</span>
  <span class="nt">"port"</span><span class="p">:</span> <span class="s2">"3011"</span><span class="p">,</span>
  <span class="nt">"adminAccount"</span><span class="p">:</span> <span class="s2">"admin@admin.com"</span><span class="p">,</span>
  <span class="nt">"db"</span><span class="p">:</span> <span class="p">{</span>
    <span class="nt">"servername"</span><span class="p">:</span> <span class="s2">"127.0.0.1"</span><span class="p">,</span>
    <span class="nt">"DATABASE"</span><span class="p">:</span>  <span class="s2">"yapi"</span><span class="p">,</span>
    <span class="nt">"port"</span><span class="p">:</span> <span class="mi">27017</span><span class="p">,</span>
    <span class="nt">"user"</span><span class="p">:</span> <span class="s2">"yapi"</span><span class="p">,</span>
    <span class="nt">"pass"</span><span class="p">:</span> <span class="s2">"yapi123"</span>
  <span class="p">},</span>
  <span class="nt">"mail"</span><span class="p">:</span> <span class="p">{</span>
    <span class="nt">"enable"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
    <span class="nt">"host"</span><span class="p">:</span> <span class="s2">"smtp.163.com"</span><span class="p">,</span>
    <span class="nt">"port"</span><span class="p">:</span> <span class="mi">465</span><span class="p">,</span>
    <span class="nt">"from"</span><span class="p">:</span> <span class="s2">"***@163.com"</span><span class="p">,</span>
    <span class="nt">"auth"</span><span class="p">:</span> <span class="p">{</span>
        <span class="nt">"user"</span><span class="p">:</span> <span class="s2">"***@163.com"</span><span class="p">,</span>
        <span class="nt">"pass"</span><span class="p">:</span> <span class="s2">"*****"</span>
    <span class="p">}</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>
     </div>
     <div class="codehilite">
      <pre><span></span><code><span class="nb">cd</span> vendors
npm install  --registry https://registry.npm.taobao.org
pm2 start server/app.js
</code></pre>
     </div>
     <h2 id="_2">
      运行
     </h2>
     <ul>
      <li>
       /usr/local/node-v8.9.3-linux-x64/bin/pm2 start server/app.js
      </li>
     </ul>
     <h2 id="_3">
      访问
     </h2>
     <ul>
      <li>
       http://nssas.eelantech.com:40008/
      </li>
     </ul>
     <h2 id="_4">
      信息记录
     </h2>
     <ul>
      <li>
       初始化管理员账号成功,账号名："admin@admin.com"，密码："ymfe.org"
      </li>
     </ul>
     <h2 id="_5">
      使用说明
     </h2>
     <p>
      <em>
       登录时使用注册邮箱进行登录，所有请记住自己的邮箱
      </em>
      首先进行注册后联系管理员添加进相应的分组
     </p>
     <h2 id="_6">
      迁移说明
     </h2>
     <p>
      迁移的时候只要复制MongoDB的中yapi数据库到新迁移环境中的MongoDB中即可
     </p>
     <h2 id="_7">
      参考链接
     </h2>
     <ul>
      <li>
       <a href="https://yapi.ymfe.org/documents/redev.html">
        安装YApi
       </a>
      </li>
     </ul>
    </article>
   </div>
   <!-- Footer -->
   <footer id="footer">
    <p class="copyright">
     © Untitled. Design:
     <a href="https://html5up.net">
      HTML5 UP
     </a>
     .
    </p>
   </footer>
  </div>
  <!-- BG -->
  <div id="bg">
  </div>
  <!-- Scripts -->
  <script src="../assets/js/jquery.min.js">
  </script>
  <script src="../assets/js/browser.min.js">
  </script>
  <script src="../assets/js/breakpoints.min.js">
  </script>
  <script src="../assets/js/util.js">
  </script>
  <script src="../assets/js/main.js">
  </script>
 </body>
</html>
